package org.jeecg.modules.workflow.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.mybatis.query.QueryWrapperX;
import org.jeecg.common.workflow.vo.definition.form.BpmFormPageReqVO;
import org.jeecg.modules.workflow.entity.BpmForm;

/**
 * 工作流的单定义Mapper接口
 *
 * @author whnk
 * @date 2022-04-20
 */
public interface BpmFormMapper extends BaseMapper<BpmForm>
{
    default IPage<BpmForm> selectPage(BpmFormPageReqVO reqVO) {
        Page<BpmForm> page = new Page<>(reqVO.getPageNum(), reqVO.getPageSize());
        return selectPage(page, new QueryWrapperX<BpmForm>()
                .likeIfPresent("name", reqVO.getName())
                .orderByDesc("id"));
    }
}
